import DefaultTheme from 'vitepress/theme';
import { useConfigHotReload } from './hot-reload';
import { onMounted } from 'vue';

export default {
  ...DefaultTheme,
  enhanceApp({ app, router }) {
    // 使用默认主题的enhanceApp
    if (DefaultTheme.enhanceApp) {
      DefaultTheme.enhanceApp({ app, router });
    }
  },
  setup() {
    // 启用配置热重载
    onMounted(() => {
      useConfigHotReload();
    });

    // 调用默认主题的setup
    if (DefaultTheme.setup) {
      DefaultTheme.setup();
    }
  },
};
